Hive操作 |
您所在的位置:网站首页 › hive分隔符 内容里也有 › Hive操作 |
这篇博文将分享给你如何将hive中B库的表复制到A库中。如下图,将cserver中的表的结构以及数据都复制到xpu中。本篇将分为两个部分:复制表结构、复制结构+数据。 写法:CREATE TABLE A.new_table LIKE B.old_table;(需要A数据库提前创建好,否则会报找不到) 这里将cserver的iot_devicelocation复制到xpu中去,首先看一下iot_devicelocation的表结构。 复制表结构:创建一个和iot_devicelocation表一样表结构的test_iiot_devicelocation表 hive> create table if not exists xpu.test_iot_devicelocation like iot_devicelocation;可以写成如下的形式:create table if not exists database_nameA.table_nameA like database_nameB.table_nameB;当你目前在那个数据库的工作空间时,就可 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |